<?php
function hasChildVideo($idp)
{
    global $dbsql;
	$idp=intval($idp);
	//-----------------------------------------------------
	$sql_select = "select iId from tblvideo where  iParentId = $idp";

	$rs=$dbsql->query($sql_select);
	$rows = $dbsql->num_rows($rs);
	if($rows>0)return true;
	return false;
}

function ListVideo($idP)
{
    global $dbsql,$language;

	$idP           = intval($idP);

    $sql_where     = "from tblvideo where cLanguage='$language' ";
    $sql_where    .= " and iParentId = $idP ";

    $sql_select    = "select count(iId) as count ".$sql_where;
    $result        = $dbsql->query_fetch($sql_select);
	$count_all	   = $result['count'];
	list($limit_st,$limit_le)	=Slit_Page($count_all);
	//-----------------------------------------------------
	$sql_select = "select * ".$sql_where." order by iOrder asc limit $limit_st,$limit_le";
    return $dbsql->load($sql_select);
}
?>